import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/mainHome',
    name: 'mainHome',
    component: () => import('@/views/main.vue'),
    meta: { title: '系统管理' },
    children: [
      {
        path: '/user/org',
        name: 'driver',
        component: () => import('@/views/modules/work/driverjob.vue'),
        meta: { title: '定时' },
      }, {
        path: '/auth/menu',
        name: 'allMenus',
        component: () => import('@/views/modules/Menu/LeftMenus.vue'),
        meta: { title: '菜单管理' },
      },
    ],
  },

  // 路由重定向
  {
    path: "*",
    // 名字在“命名路由”中使用。但是不介绍
    name: "any",
    redirect: "/mainHome"
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
